import torch.nn as nn

input_dim=100
num_channels=1
num_features=64

class ModelG(nn.Module):
    def __init__(self):
        super(ModelG, self).__init__()
        self.model = nn.Sequential()

        self.model.add_module('deconv1', nn.ConvTranspose2d(input_dim, num_features * 2, 5, 2, 0, bias=False))
        self.model.add_module('bnorm1', nn.BatchNorm2d(num_features * 2))

        self.model.add_module('relu1', nn.ReLU(True))

        self.model.add_module('deconv2', nn.ConvTranspose2d(num_features * 2, num_features, 5, 2, 0, bias=False))
        self.model.add_module('bnorm2', nn.BatchNorm2d(num_features))

        self.model.add_module('relu2', nn.ReLU(True))

        self.model.add_module('deconv3', nn.ConvTranspose2d(num_features, num_channels, 4, 2, 0, bias=False))  # [64,1]

        self.model.add_module('sigmoid', nn.Sigmoid())

    def forward(self, input):
        output = input

        for name, module in self.model.named_children():
            output = module(output)

        return output